package cn.linshu.security.jwt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * -*- coding: utf-8 -*-
 *
 * @Author linnin
 * @Name springboot3-labs-master
 * @Time 2025/2/5 21:05
 * @Note
 * @For
 * @Out Copyright© 2025 linnin
 */

/* coding: utf-8 */
/*
CREATE TABLE `sys_token_user`
(
    -- 主键，自增
    `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    -- 存储token，长度为500
    `token` VARCHAR(500) NOT NULL,
    -- 关联用户表的id
    `user_id` INT(11) NOT NULL,
    -- 创建时间，默认为当前时间
    `create_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    -- 更新时间，默认为当前时间
    `update_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    -- 过期时间，默认为当前时间
    `expire_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
 */
@Data
@Builder
public class SysTokenUser {
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    private String token;

    @TableField("create_at")
    private LocalDateTime createAt;

    @TableField("update_at")
    private LocalDateTime updateAt;

    @TableField("expire_at")
    private LocalDateTime expireAt;

}
